<?php
namespace Admin\Frontend\Controllers;

use Helpers\Main;
use Helpers\Tool;
use Helpers\Assets;
use Helpers\Template;
use Phalcon\Mvc\View;
use Phalcon\Mvc\View\Engine\Volt;
use Admin\Models\server\BoxNet;

class BoxNetController extends ControllerBase
{
    /**
     * [indexAction description]
     * @method indexAction
     * @return [page]      [加速盒子服务状态页面]
     */
    public function indexAction()
    {
      Assets::easyUI();
      Assets::importJs('js/box_net/box_net.js');
      Main::showNavPosition();
    }

    /**
     * [listAction description]
     * @method listAction
     * @return [json]     [返回源自表'box_net_stat'的数据]
     */
    public function searchAction(){
      $requestData = $this->request->getPost();
      if($this->request->isPost()) {
          $data = BoxNet::search($requestData);
          return json_encode($data);
      }
      else{
        return $this->sendViewError('请求规则错误');
      }
    }

}
